package com.alfayun.fiscalriskanalysis.systemlogs;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/client/systemLogs")
public class SystemLogsController {
	
	@Autowired
	private SystemLogsService service;
	
	@RequestMapping("/transaction")
	public String transaction() {
		return "client/transaction-history";
	}
	
	@ResponseBody
	@GetMapping("/transaction/data/{period}")
	public Map<String, List<SystemLogs>> listData(@PathVariable String period, String[] type, String[] status) {
		Map<String, List<SystemLogs>> map = new HashMap<>();
		map.put("data", service.transactionList(period, type, status));
		return map;
	}
	
	@RequestMapping("/invitation")
	public String invitation() {
		return "client/invitation-record";
	}

}
